package zy011;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class zy1 {
	public static void main(String[] args) throws IOException {
		Reader reader=new FileReader("abc.txt");
		BufferedReader br=new BufferedReader(reader);
		Writer out=new FileWriter("abc.txt");
		BufferedWriter bw=new BufferedWriter(out);
		List<Integer> list=new ArrayList<>();
		String line=null;
		while((line=br.readLine())!=null){
			String[] split = line.split("-");
			for(String num:split){
				list.add(Integer.parseInt(num));
			}
			Collections.sort(list);
			for(int i=0;i<list.size();i++){
				if(i<list.size()-1){
					bw.write(list.get(i)+"-");
				}else{
					bw.write(list.get(i));
				}
			}
		}
		br.close();
		bw.close();
	}
}
